<script setup lang="ts">
// 接受props
let props = defineProps(['modelValue']);
let $emit = defineEmits(['update:modelValue'])
// 触发事件，提交修改数据
const handler = () => {
  $emit('update:modelValue',props.modelValue+10)
}

</script>

<template>
<div class="child">
  <h1>钱数:{{modelValue}}</h1>
  <el-button @click="handler">父子组件实现数据同步</el-button>
</div>
</template>

<style scoped>
.child {
  width: 300px;
  height: 300px;
  background: aqua;
}
</style>